import 'package:base_plugin/base_plugin.dart';
import 'package:finance_app/src/common/app_colors.dart';
import 'package:flutter/material.dart';

class SquareButton extends StatelessWidget {
  final EdgeInsets padding;
  final String title;
  final VoidCallback onTap;

  const SquareButton(
      {Key key,
      this.title,
      this.onTap,
      this.padding = const EdgeInsets.only(left: 40.0, right: 40)})
      : super(key: key);

  @override
  Widget build(BuildContext context) {
    final text = Text(
      title,
      style: TextStyle(
        color: Colors.white,
        fontSize: getSp(16),
        fontWeight: FontWeight.w700,
        height: 20 / 16,
      ),
    );
    return Padding(
      padding: padding,
      child: Center(
        child: PressedOpacityButton(
          onPressed: onTap,
          disabledColor: aceGrayColor,
          color: aceBlueColor,
          borderRadius: BorderRadius.circular(getDp(6)),
          child: Container(
            height: 48,
            alignment: Alignment.center,
            child: text,
          ),
        ),
      ),
    );
  }
}
